﻿using System;
using System.Collections.Generic;
using System.Text;
using RTCCore;

namespace LibRTC.Core.MessageMap
{
    /// <summary>
    /// Message Handler interface, every message handler should implement this interface
    /// </summary>
    public interface IMessageHandler
    {
        /// <summary>
        /// Name Attribute, used to identify the handler
        /// </summary>
        /// <returns>Name of this component</returns>
        string Name();

        /// <summary>
        /// Attribute, used to indicate what type of event this handler would deal with
        /// </summary>
        /// <returns>RTC Event</returns>
        RTC_EVENT Event();

        /// <summary>
        /// Register a Handler to deal with an event
        /// </summary>
        /// <param name="handler">Handler</param>
        void RegisterHandler(IMessageHandler handler);

        /// <summary>
        /// Process the event
        /// </summary>
        /// <param name="rtcEventType"> type of event</param>
        /// <param name="rtcEvent"> event object </param>
        void Process(RTC_EVENT rtcEventType, object rtcEvent);
    }
}
